<?php
$tour = $this->tour;
$tourHotel = $this->tourHotel;

if(!$tour) {
    echo $this->translate('Data not found!');
    die;
}
?>
<div class="wrapper-content">
    <div class="top-title">
        <div class="content-title">
            <h2><?php echo $this->translate('Tour') ?></h2>
        </div>
    </div>

    <div class="span4" id="content-left-2">
        <!-- column left -->
        <?php $columnLeft = $this->columnLeft; ?>
        <?php if($columnLeft): ?>
            <?php foreach($columnLeft as $key => $value): ?>
                <div class="block-left-2">
                	<div class="block-left-2-title">
                		<h4><?php echo $value['name']; ?></h4>
                	</div>
                	<div class="block-left-2-content">
                		<ul>
                		    <!-- tour -->
                		    <?php if($value['list_tour_category']): ?>
                		    <?php foreach($value['list_tour_category'] as $k => $v):?>
                			<li>
                				<a href="<?php echo '/tour/1/'.$v['id'].'-'. $value['id'] . '-'.str_replace(' ', '-' ,trim($v['tour_category_title'])) .'.html';?>" class="<?php if($this->id == $v['id'] && $this->country['id'] == $value['id']){ echo "menu-left-active";} else echo ""; ?>">
                				    <?php echo $v['tour_category_title'];?>
                				</a>
                			</li>
                			<?php endforeach; ?>
                			<?php endif; ?>

                			<!-- cruise -->
                		    <?php if($value['list_cruise_category']): ?>
                		    <?php foreach($value['list_cruise_category'] as $k => $v):?>
                			<li>
                				<a href="<?php echo '/cruise/1/'.$v['id'].'-'. $value['id'] . '-'.str_replace(' ', '-' ,trim($v['cruise_category_title'])) .'.html';?>">
                				    <?php echo $v['cruise_category_title'];?>
                				</a>
                			</li>
                			<?php endforeach; ?>

                			<!-- Vietnam trip in style -->
                			<?php if($value['id'] == 1): ?>
                			<li class="menu-left sub-menu">
                				<a href="#a" class="parent-menu">
                				    <?php echo $this->translate('VietNam_trip_in_style');?>
                				</a>
                				<?php if($this->listTourStyle): ?>
                				<ul class="child-menu" data-display="none">
                                    <?php foreach($this->listTourStyle as $k => $v): ?>
                    				    <li><a href="<?php echo '/tour/trip-in-style/1/'.$v['id'].'-'. $value['id'] . '-'.str_replace(' ', '-' ,trim($v['tour_style_title'])) .'.html';?>"><?php echo $v['tour_style_title'] ?></a></li>
                				    <?php endforeach; ?>
                				</ul>
                				<?php endif; ?>
                			</li>
                			<?php endif; ?>

                			<!-- hotel -->
                			<?php endif; ?>
                			<li>
                				<a href="/hotel"><?php $name = $value['name']; echo $this->translate("$name'_s_hotels"); ?></a>
                			</li>
                		</ul>
                		<div class="clear"><img class="spacer" src="/static/default/images/spacer.gif" /></div>
                	</div>
                </div>
        	<?php endforeach; ?>
        <?php endif; ?>
        <!-- end column left -->
        <div class="clear" style="width: 100%; height: 20px;"></div>
    </div>

    <?php $url = "/tour/detail/". $tour['id'].'-'.str_replace(' ', '-' ,trim($tour['title'])).'.html'; ?>
    <div class="span12" id="content-right-2">
    	<div class="content-right-2-content">
            <div class="top-detail">
                <img class="thumbnail-detail" src="<?php echo $tour['detail_thumbnail'] ? $tour['detail_thumbnail'] : $tour['thumbnail']; ?>" />
                <div class="top-right-detail">
                    <h4 style="line-height:20px;"><?php echo $tour['title']; ?></h4>
                    <div class="detail-overview">
                        <p style="font-size: 13px;"><?php echo $this->snippet($tour['overview'], 400); ?></p>
                    </div>
                </div>
            </div>
            <div class="detail-like">
                <div class="add-this-botton">
	                <!-- AddThis Button BEGIN -->
					<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-500bc4165d38d108"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
					<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
					<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-500bc4165d38d108"></script>
					<!-- AddThis Button END -->
				</div>
                <div class="plusone google-plus">
                   <g:plusone size="medium"></g:plusone>
                </div>
                <div class="facebook-like">
                   <div class="fb-like" data-href="<?php echo $this->serverUrl().$url; ?>" data-send="true" data-width="450" data-show-faces="false"></div>
                </div>
            </div>
            <div class="block-content">
                <div class="detail-nav">
                    <div style="width:390px;float:left" id="tab-view">
            		    <ul class="nav nav-tabs">
                            <li class="tab active" data-tab="detail" id="tab-detail">
                                <a href="#a" data-toggle="tab"><?php echo $this->translate('Overview'); ?></a>
                            </li>
                            <li class="tab" data-tab="itinerary" id="tab-itinerary">
                                <a href="#a" data-toggle="tab"><?php echo $this->translate('Itinerary'); ?></a>
                            </li>
                            <li class="tab" data-tab="price" id="tab-price">
                                <a href="#a" data-toggle="tab"><?php echo $this->translate('Price'); ?></a>
                            </li>
                        </ul>
            		</div>
            		<div class="btn-detail">
            		    <a href="/enquire/index/t/1/id/<?php echo $tour['id']; ?>" class="btn btn-enquire"><?php echo $this->translate('Enquire_Now') ?></a>
            		    <a href="/send-to-friend/index/t/1/id/<?php echo $tour['id']; ?>" class="btn btn-send-mail"><?php echo $this->translate('Share_This_Offer') ?></a>
            		</div>
                </div>
                <div class="clear"></div>
                <div class="tab-content">
                    <div class="tab-pane active" id="detail"><?php echo $tour['detail'] ?></div>
                    <div class="tab-pane" id="itinerary"><?php echo $tour['itinerary'] ?></div>
                    <div class="tab-pane" id="price">
                        <!-- price table -->
                        <table class="table tbl">
                            <thead>
                                <tr>
                                    <th colspan="2"><?php echo $this->translate('Hotel') ?></th>
                                    <th colspan="5"><?php echo $this->translate('Price/Per Pax(USD)'); ?>
                                    	<br/><?php echo $this->translate('Base_on_TWN/DBL_sharing'); ?>
                                    </th>
                                    <th rowspan="2"><?php echo $this->translate('SGL_Supp'); ?></th>
                                </tr>
                                <tr>
                                    <th><?php echo $this->translate('Rating') ?></th>
                                    <th><?php echo $this->translate('Name'); ?></th>
                                    <?php if($tourHotel): ?>
                                        <?php foreach($tourHotel[0]['price'] as $k => $v): ?>
                                            <th><?php echo $v['number_customer'] ?></th>
                                        <?php endforeach; ?>
                                    <?php else:  ?>
                                        <th> 2-3 </th>
                                        <th> 4-7 </th>
                                        <th> 8-11 </th>
                                        <th> 12-14 </th>
                                        <th> 15+1 </th>
                                    <?php endif; ?>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if($tourHotel): ?>
                                    <?php foreach($tourHotel as $key => $value): ?>
                                        <tr>
                                            <td><?php echo $value['hotel_rating'] ?></td>
                                            <td  style="text-align:left"><?php echo $value['hotel_name'] ?></td>
                                            <?php foreach($value['price'] as $k => $v): ?>
                                                <td><?php echo $v['price'] ?></td>
                                            <?php endforeach; ?>
                                            <td><?php echo $value['sgl_supp'] ?></td>
                                        </tr>
                                    <?php endforeach; ?>
                                <?php else: ?>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                        <!-- end price table -->
                        <div class="note-price">
                            <?php echo $tour['note_price']; ?>
                        </div>
                    </div>
                </div>
            </div>
    	</div>
    </div>
</div>
<div id="fb-root"></div>
<script>
$(document).ready(function() {
    $('.tab').click(function() {
    	$('.active').removeClass('active');
    	$(this).addClass("active");
    	$("#"+ $(this).attr('data-tab')).addClass("active");
    });
});
</script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>